<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/core/common/taglibs.jsp" %>
<%@ include file="/WEB-INF/core/common/top.jsp" %>
<head>
	<title>VOD Type</title>
</head>

<script src="${ctx}/core/scripts/dhtmlXCommon.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/dhtmlXTree.js" type="text/javascript" charset="UTF-8"></script>
<script language="javascript">
<!--
   var tree=null;
	function initGenreTree(){
	  	tree=new dhtmlXTreeObject(document.getElementById('genreTree'),"100%","100%",0);
	  	tree.setImagePath("${ctx}/core/images/");
	  	tree.enableCheckBoxes(true);
		tree.enableDragAndDrop(false);
		tree.enableTreeImages(false);
		tree.loadXML("${ctx}/contentManage/metadataOpt.action?act=loadXmlTree&contentId=<s:property value='contentId'/>");//load root level from xml
	  } 
	  
	 function selectGenre(){
	 	var checkIds=tree.getAllChecked();
	 	var checkIdArr=checkIds.split(',');
	 	
	 	var itemText='';
	 	for(var i=0;i<checkIdArr.length;i++){
	 		itemText+=tree.getItemText(checkIdArr[i]);
	 		if(i!=checkIdArr.length-1) itemText+=',';
	 	}
	 	window.opener.document.getElementById("genreText").value=itemText;
	 	window.opener.document.getElementById("genre").value=checkIds;
	 	window.close();
	 } 	     
//-->
</script>
<body style="overflow-x:hidden;overflow-y:auto;">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>
    <td class="biaoge">	
					<s:text name="vod.genre"/>
					<div id="genreTree" style="height: 350; text-align: left; overflow: auto;">
						</div>
						<script>
							initGenreTree();
						</script>

    </td></tr>
                 <tr height=30>
                      <td align="center">
							<input name="button22" type="submit" class="btn" value=" <s:text name='button.save'/> " onClick="selectGenre();"/>
			                &nbsp;<input type="button" name="Button11" value=" <s:text name='button.cancel' /> " class="btn" onClick="window.close();" />
			           </td>
                 </tr>    
    
    </table>
</body>